<#assign c = JspTaglibs["http://java.sun.com/jsp/jstl/core"] >
<#assign fmt = JspTaglibs["http://java.sun.com/jsp/jstl/fmt"] >
<#assign sp = JspTaglibs["http://www.springframework.org/tags"] >

<div *ngIf="dataTable && dataResult" style="overflow-x:scroll;">
<div class="fieldset_border fieldset_bg" *ngIf="filters">
	<div class="legend_title">过滤条件</div>
	<span *ngFor="let filter of filters"><label>{{filter.name}}</label><input type="text" [(ngModel)]="queryParam[filter.code]"/></span>
	<button (click)="getDataTableDatas()">刷新</button>
</div>
<pagination-controls id="uTablePg" (pageChange)="getDataTableDatas($event)" 
previousLabel="<@sp.message code='ngx.previous'/>" nextLabel="<@sp.message code='ngx.next'/>"></pagination-controls>
<table class="resultTable"><caption><@sp.message code="table.detail"/></caption>
	<!-- 首先，开始表的标题行展现 -->
	<thead>
	<tr>
		<th *ngFor="let column of dataTable.columns" [attr.style]="sanitizer.bypassSecurityTrustStyle(column.style)">{{column.name}}</th>
	</tr>
	</thead><tbody>
	<!-- 其次，开始表的内容行 -->
	
	<tr *ngFor="let rowData of dataResult.datas | paginate: { id: 'uTablePg', itemsPerPage: queryParam.pageSize, currentPage: queryParam.pageNumber, totalItems: dataResult.recordCount}">
		<td *ngFor="let column of dataTable.columns; let index=index" [attr.style]="sanitizer.bypassSecurityTrustStyle(dataTable.columns[index].style)">
			<span *ngIf="dataTable.columns[index].options">
			{{dataTable.columns[index].options[rowData[index]]}}
			</span >
			<span *ngIf="!dataTable.columns[index].options">
				{{format(rowData[index], dataTable.columns[index])}}
			</span>
		</td>
	</tr>
	</tbody>
</table>
</div>
